<template>
  <h1>El-日期时间选择器组件</h1>
  <el-date-picker
      type="date"
      v-model="rq"
      format="YYYY-MM-DD"
      value-format="YYYY-MM-DD"
      @change="console.log(rq)"
  ></el-date-picker>
  <br>
  <el-date-picker
      type="datetimerange"
      range-separator="~"
      start-placeholder="开始啦"
      end-placeholder="结束啦"
      v-model="times"
      format="YYYY-MM-DD HH:mm:ss"
      value-format="YYYY/MM/DD HH:mm:ss"
      @change="console.log(times)"
  ></el-date-picker>
</template>

<script setup>
import {ref} from "vue";

const rq = ref('');
//因为要保存开始时间与结束时间,所以要使用数组
const times = ref([]);
</script>

<style scoped>

</style>